const Router = require('koa-router')

const roleController = require('../../controllers/role')

const m = require('../../middlewares/admin_auth')

const router = new Router({ prefix: '/admin/api/v1/role' })


router.get('/getList', m.auth,roleController.list);


router.get('/getValidList',m.auth,roleController.getValidList);


router.post('/create', m.auth,roleController.create)


router.get('/detail/:id',m.auth, roleController.detail)


router.delete('/:id', m.auth, roleController.delete)


router.patch('/:id', m.auth, roleController.update)

router.get('/getRoleMenuList',m.auth,roleController.getRoleMenuList);

router.post('/setRoleMenu',m.auth,roleController.setRoleMenu);

module.exports = router
